<?php

namespace App\Logic;

use Illuminate\Support\Facades\Cache;

class Code
{

    public static function code($key,$code){
        //验证验证码逻辑
        $cache_code = Cache::get($key);

        if( !$cache_code ) {

            return e_msg(300013,'请重新发送验证码');

        }

        if( $cache_code != $code ) {

            return e_msg('300014','验证码不正确');

        }

        return s_msg('');
    }


}





